package io.lkt.common.file.service.impl;

import io.lkt.common.file.service.OssService;
import io.lkt.common.utils.AliyunOssClientUtil;
import org.springframework.stereotype.Service;

import java.net.InetAddress;

@Service
public class OssServiceImpl implements OssService {

    public String updateFile(String ossKey, String ossValue) {

        String reutrnStr = "OK";
        try {
            AliyunOssClientUtil.uploadFileByUrl(ossKey, ossValue);
            System.out.println(InetAddress.getLocalHost().toString());
        } catch (Exception e) {
            reutrnStr="Err";
            System.out.println("OssServiceImpl:" + e.getMessage());
        } finally {
            return reutrnStr;
        }
    }
}
